package main;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author chau
 */
public class PlayerInfo {

    private String friendName;
    private int isOnline;
    private int gender;
    private int isMaried;
    private String status = "chưa có !";
    private long money;
    private int level;
    private int numberWins;
    private int numberLoses;
    private int[] childeGender;
    private String[] childNames;
    private int childIndex;
    private String matName;
    protected int avatarId;
    protected int levelPercent;

    public PlayerInfo(String friendName, int isOnline, String status, int gender, int isMaried, int avatarId) {
        this.friendName = friendName;
        this.isOnline = isOnline;
        this.status = status;
        this.gender = gender;
        this.isMaried = isMaried;
        this.avatarId = avatarId;
        if (status.equals("0")) {
            this.status = "không có ";
        } else {
            this.status = status;
        }
    }
 
    public PlayerInfo(String friendName, long money, int gender, int level, int numberWin, int numberLose, String status) {
        this.friendName = friendName;
        this.money = money;
        this.gender = gender;
        this.level = level;
        this.numberWins = numberWin;
        this.numberLoses = numberLose;
        if (status.equals("0")) {
            this.status = "không có ";
        } else {
            this.status = status;
        }
    }

    public void setLevelComplete(int complete) {
        this.levelPercent = complete;
    }

    public void initTest() {
        if (Debug.isTest) {
            childIndex = 2;
            childeGender = new int[childIndex];
            childNames = new String[childIndex];
            for (int i = 0; i < childIndex; i++) {
                childeGender[i] = 1;
                childNames[i] = "child name :" + i;
//                Debug.d("chil name");
            }
            Debug.d("n childs init :" + getNumberChild());
        }
        
    }

    public PlayerInfo(String name, long money, int level) {
        this.friendName = name;
        this.money = money;
        this.level = level;
    }

    public void setName(String name) {
        this.friendName = name;
    }

    public String getName() {
        return this.friendName;
    }

    public int getNumberChild() {
        return this.childIndex;
    }

    public String getChildName(int index) {
        return this.childNames[index];
    }

    public int getLevel() {
        return this.level;
    }

    public int getNumberWin() {
        return this.numberWins;

    }

    public int getNumberLoses() {
        return this.numberLoses;
    }

    public int getChildGender(int index) {
        return this.childeGender[index];
    }

    public long getMoney() {
        return this.money;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return this.status;
    }

    public void setOnline(int online) {
        this.isOnline = online;
    }

    public int getIsOnline() {
        return this.isOnline;
    }

    public void setGedner(int gender) {
        this.gender = gender;

    }

    public int getGender() {
        return this.gender;
    }

    public void setIsMaried(int maried) {
        isMaried = maried;
        if (isMaried == 1) {
            childIndex = 0;
            childNames = new String[2];
            childeGender = new int[2];
        }
    }

    public void setChildName(String name) {
        childNames[childIndex] = name;
    }

    public void setChildGender(int gender) {
        childeGender[childIndex] = gender;
        childIndex++;
    }

    public void setMateName(String name) {
        this.matName = name;
    }

    public int getIsMaried() {
        return this.isMaried;
    }

    public String getMatName() {
        return this.matName;
    }
}
